package cn.edu.scau.cmi.huangxiyan.adapter;

import java.util.ArrayList;
import java.util.List;

public class ObjectAdapter implements ScoreOperation {

	@Override
	public List<Student> sort(List<Student> studentList) {
		List<Integer> intList = new ArrayList<Integer>();
		for (Student student : studentList) {
			intList.add(student.getNO());
		}

		SortUtil so = new SortUtil();
		so.sortInt(intList);

		List<Student> resultList = new ArrayList<Student>();
		for (int NO : intList) {
			for (Student student : studentList) {
				if (NO == student.getNO()) {
					resultList.add(student);
					break;
				}
			}
		}

		return resultList;
	}

}
